{extend name="public:base" /}
{block name="main"}
    <div class="ShareAnyContainer" style="font-size: 14px;">
        当前位置：<a href="{:url('shop/index/index')}" title="首页">首页</a>&nbsp;&nbsp;/&nbsp;&nbsp;<a
            href="{:url('shop/account/pay')}" title="充值">充值</a>
    </div>
    <div class="ShareAnySeparate"></div>
    <div class="ShareAnyContainer">
        <div class="line"></div>
    </div>
    <div class="ShareAnySeparate"></div>
    <div class="ShareAnyContainer">
        <style>
            .form input{
                width:300px;
                padding:5px;
            }
            .form input:focus{
                border:1px solid #ff0000;
            }
        </style>
        <table style="width:100%;" border="0">
            <tr>
                <td valign="top" width="20%">{include file="public/account" /}</td>
                <td valign="top" width="5%">&nbsp;</td>
                <td valign="top" width="75%" style="line-height: 50px; text-align: center;" class="form">
                    <p style="text-align: left; font-size: 25px;">充值</p>
                    <p>金额：&nbsp;&nbsp;&nbsp;<input type="text" id="money"></p>
                    <p>
                        <button id="submit" style="padding:10px 25px;">充值</button>
                    </p>

                </td>
            </tr>
        </table>
    </div>
{/block}
{/block}
{block name="footer"}
    <script>
        $(document).ready(function () {
            $("#submit").on("click", function () {
                if($("#money").val()==''){
                    alert('请输入金额');
                    return;
                }
                $.ajax({
                    url: "{:url('shop/account/ajaxPay')}",
                    type: "POST",
                    dataType: "JSON",
                    data: {
                        money: $("#money").val()
                    },
                    success: function (data) {
                        alert(data.msg);
                        if (data.code == "0") {
                            window.location.href = "{:url('shop/account/money')}";
                        }

                    }
                });
            });
        });
    </script>
{/block}